<template>
  <div>
      <el-table
            :data="data"
            border
            highlight-current-row
            style="width: 100%">
            <el-table-column
              prop="id"
              label=业务编号
              width="180">
            </el-table-column>
            <el-table-column
              prop="name"
              label="业务名称"
              width="180">
            </el-table-column>
            <el-table-column
              label="所属部门">
              <template slot-scope="scope">
                <span  style="margin-left: 10px" v-for="(item) in scope.row.department">{{item.name}}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="income"
              label="总收入">
            </el-table-column>
            <el-table-column
              prop="pay"
              label="总支出">
            </el-table-column>
            <el-table-column
              prop="profit"
              label="总收益">
            </el-table-column>
            <el-table-column
              prop="manage"
              label="管理">
            </el-table-column>
       </el-table>
      <div>
        <el-pagination
          background
          layout="prev, pager, next"
          :total="1000">
        </el-pagination>
      </div>
  </div>
</template>
<script>
import axios from 'axios'
import {business, getHeader} from '../../../config/config'
  export default {
    name:'business',
    data() {
      return {
        data: []
      }
    },
    mounted(){
        this.init();
    },
    methods:{
      init(){
        var that=this;
        axios.get(business,{header:getHeader()},{'page':1,'limit':1})
        .then(function(res){
          that.data=res.data.data.data;
        })
      }
    }

  }
</script>
<style>
 .el-table th>.cell{
   text-align:center;
 }
 .el-pagination{
   background:#fff;
   padding: 20px 5px;
 }
 .el-table{
  margin-top:30px;
 }
</style>
